from django.test import TestCase

# Create your tests here.
# class NextContentView(APIView):
#
#     def get(self, request, *args, **kwargs):
#         #
#         navle_id = request.query_params.get('navle_id')
#         article_id = kwargs.get('content_id')
#         print(navle_id, article_id)
#         article = models.Article.objects.filter(book_id=navle_id, id=article_id).first()
#         ser = serializer.BookContentModelSerializer(instance=article)
#         return Response(ser.data)

import os
import django
from datetime import timedelta
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NavelApi.settings.dev')
django.setup()

from book import models
book = models.Book.objects.filter(pk=1).first()
print(book.created_time, type(book.created_time))
print(book.created_time - timedelta(days=3))